package com.dianping.cat.consumer.transaction.model.entity;

import com.dianping.cat.consumer.transaction.model.BaseEntity;
import com.dianping.cat.consumer.transaction.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;







public class TransactionType
  extends BaseEntity<TransactionType>
{
  private String m_id;
  private long m_totalCount;
  private long m_failCount;
  private double m_failPercent;
/*  22 */   private double m_min = 8.64E7D;

  private double m_max = -1.0D;

  private double m_avg;

  private double m_sum;

  private double m_sum2;

  private double m_std;

  private String m_successMessageUrl;

  private String m_failMessageUrl;

/*  38 */   private Map<String, TransactionName> m_names = new ConcurrentHashMap();

  private double m_tps;

  private double m_line95Value;

  private double m_line99Value;

  private double m_line999Value;

  private double m_line90Value;

/*  50 */   private Map<Integer, Graph2> m_graph2s = new ConcurrentHashMap();

/*  52 */   private Map<Integer, AllDuration> m_allDurations = new ConcurrentHashMap();

  private GraphTrend m_graphTrend;

/*  56 */   private Map<Integer, Range2> m_range2s = new ConcurrentHashMap();

  private double m_line50Value;

  private double m_line9999Value;

  private String m_longestMessageUrl;

/*  64 */   private Map<String, String> m_dynamicAttributes = new LinkedHashMap();





/*  70 */   public TransactionType(String id) { this.m_id = id; }




/*  75 */   public void accept(IVisitor visitor) { visitor.visitType(this); }


  public TransactionType addAllDuration(AllDuration allDuration) {
/*  79 */     this.m_allDurations.put(Integer.valueOf(allDuration.getValue()), allDuration);
/*  80 */     return this;
  }

  public TransactionType addGraph2(Graph2 graph2) {
/*  84 */     this.m_graph2s.put(Integer.valueOf(graph2.getDuration()), graph2);
/*  85 */     return this;
  }

  public TransactionType addName(TransactionName name) {
/*  89 */     this.m_names.put(name.getId(), name);
/*  90 */     return this;
  }

  public TransactionType addRange2(Range2 range2) {
/*  94 */     this.m_range2s.put(Integer.valueOf(range2.getValue()), range2);
/*  95 */     return this;
  }


  public boolean equals(Object obj) {
/* 100 */     if (obj instanceof TransactionType) {
/* 101 */       TransactionType _o = (TransactionType)obj;

/* 103 */       if (!equals(getId(), _o.getId())) {
/* 104 */         return false;
      }

/* 107 */       return true;
    }

/* 110 */     return false;
  }


/* 114 */   public AllDuration findAllDuration(int value) { return (AllDuration)this.m_allDurations.get(Integer.valueOf(value)); }



/* 118 */   public Graph2 findGraph2(int duration) { return (Graph2)this.m_graph2s.get(Integer.valueOf(duration)); }



/* 122 */   public TransactionName findName(String id) { return (TransactionName)this.m_names.get(id); }



/* 126 */   public Range2 findRange2(int value) { return (Range2)this.m_range2s.get(Integer.valueOf(value)); }


  public AllDuration findOrCreateAllDuration(int value) {
/* 130 */     AllDuration allDuration = (AllDuration)this.m_allDurations.get(Integer.valueOf(value));

/* 132 */     if (allDuration == null) {
/* 133 */       synchronized (this.m_allDurations) {
/* 134 */         allDuration = (AllDuration)this.m_allDurations.get(Integer.valueOf(value));

/* 136 */         if (allDuration == null) {
/* 137 */           allDuration = new AllDuration(value);
/* 138 */           this.m_allDurations.put(Integer.valueOf(value), allDuration);
        }
      }
    }

/* 143 */     return allDuration;
  }

  public Graph2 findOrCreateGraph2(int duration) {
/* 147 */     Graph2 graph2 = (Graph2)this.m_graph2s.get(Integer.valueOf(duration));

/* 149 */     if (graph2 == null) {
/* 150 */       synchronized (this.m_graph2s) {
/* 151 */         graph2 = (Graph2)this.m_graph2s.get(Integer.valueOf(duration));

/* 153 */         if (graph2 == null) {
/* 154 */           graph2 = new Graph2(duration);
/* 155 */           this.m_graph2s.put(Integer.valueOf(duration), graph2);
        }
      }
    }

/* 160 */     return graph2;
  }

  public TransactionName findOrCreateName(String id) {
/* 164 */     TransactionName name = (TransactionName)this.m_names.get(id);

/* 166 */     if (name == null) {
/* 167 */       synchronized (this.m_names) {
/* 168 */         name = (TransactionName)this.m_names.get(id);

/* 170 */         if (name == null) {
/* 171 */           name = new TransactionName(id);
/* 172 */           this.m_names.put(id, name);
        }
      }
    }

/* 177 */     return name;
  }

  public Range2 findOrCreateRange2(int value) {
/* 181 */     Range2 range2 = (Range2)this.m_range2s.get(Integer.valueOf(value));

/* 183 */     if (range2 == null) {
/* 184 */       synchronized (this.m_range2s) {
/* 185 */         range2 = (Range2)this.m_range2s.get(Integer.valueOf(value));

/* 187 */         if (range2 == null) {
/* 188 */           range2 = new Range2(value);
/* 189 */           this.m_range2s.put(Integer.valueOf(value), range2);
        }
      }
    }

/* 194 */     return range2;
  }


/* 198 */   public String getDynamicAttribute(String name) { return (String)this.m_dynamicAttributes.get(name); }



/* 202 */   public Map<String, String> getDynamicAttributes() { return this.m_dynamicAttributes; }



/* 206 */   public Map<Integer, AllDuration> getAllDurations() { return this.m_allDurations; }



/* 210 */   public double getAvg() { return this.m_avg; }



/* 214 */   public long getFailCount() { return this.m_failCount; }



/* 218 */   public String getFailMessageUrl() { return this.m_failMessageUrl; }



/* 222 */   public double getFailPercent() { return this.m_failPercent; }



/* 226 */   public Map<Integer, Graph2> getGraph2s() { return this.m_graph2s; }



/* 230 */   public GraphTrend getGraphTrend() { return this.m_graphTrend; }



/* 234 */   public String getId() { return this.m_id; }



/* 238 */   public double getLine50Value() { return this.m_line50Value; }



/* 242 */   public double getLine90Value() { return this.m_line90Value; }



/* 246 */   public double getLine95Value() { return this.m_line95Value; }



/* 250 */   public double getLine9999Value() { return this.m_line9999Value; }



/* 254 */   public double getLine999Value() { return this.m_line999Value; }



/* 258 */   public double getLine99Value() { return this.m_line99Value; }



/* 262 */   public String getLongestMessageUrl() { return this.m_longestMessageUrl; }



/* 266 */   public double getMax() { return this.m_max; }



/* 270 */   public double getMin() { return this.m_min; }



/* 274 */   public Map<String, TransactionName> getNames() { return this.m_names; }



/* 278 */   public Map<Integer, Range2> getRange2s() { return this.m_range2s; }



/* 282 */   public double getStd() { return this.m_std; }



/* 286 */   public String getSuccessMessageUrl() { return this.m_successMessageUrl; }



/* 290 */   public double getSum() { return this.m_sum; }



/* 294 */   public double getSum2() { return this.m_sum2; }



/* 298 */   public long getTotalCount() { return this.m_totalCount; }



/* 302 */   public double getTps() { return this.m_tps; }




  public TransactionType incFailCount() {
/* 315 */     this.m_failCount++;
/* 316 */     return this;
  }

  public TransactionType incFailCount(long failCount) {
/* 320 */     this.m_failCount += failCount;
/* 321 */     return this;
  }

  public TransactionType incTotalCount() {
/* 325 */     this.m_totalCount++;
/* 326 */     return this;
  }

  public TransactionType incTotalCount(long totalCount) {
/* 330 */     this.m_totalCount += totalCount;
/* 331 */     return this;
  }


  public void mergeAttributes(TransactionType other) {
/* 336 */     assertAttributeEquals(other, "type", "id", this.m_id, other.getId());

/* 338 */     for (Map.Entry<String, String> e : other.getDynamicAttributes().entrySet()) {
/* 339 */       this.m_dynamicAttributes.put(e.getKey(), e.getValue());
    }

/* 342 */     this.m_totalCount = other.getTotalCount();

/* 344 */     this.m_failCount = other.getFailCount();

/* 346 */     this.m_failPercent = other.getFailPercent();

/* 348 */     this.m_min = other.getMin();

/* 350 */     this.m_max = other.getMax();

/* 352 */     this.m_avg = other.getAvg();

/* 354 */     this.m_sum = other.getSum();

/* 356 */     this.m_sum2 = other.getSum2();

/* 358 */     this.m_std = other.getStd();

/* 360 */     this.m_tps = other.getTps();

/* 362 */     this.m_line95Value = other.getLine95Value();

/* 364 */     this.m_line99Value = other.getLine99Value();

/* 366 */     this.m_line999Value = other.getLine999Value();

/* 368 */     this.m_line90Value = other.getLine90Value();

/* 370 */     this.m_line50Value = other.getLine50Value();

/* 372 */     this.m_line9999Value = other.getLine9999Value();
  }


/* 376 */   public AllDuration removeAllDuration(int value) { return (AllDuration)this.m_allDurations.remove(Integer.valueOf(value)); }



/* 380 */   public Graph2 removeGraph2(int duration) { return (Graph2)this.m_graph2s.remove(Integer.valueOf(duration)); }



/* 384 */   public TransactionName removeName(String id) { return (TransactionName)this.m_names.remove(id); }



/* 388 */   public Range2 removeRange2(int value) { return (Range2)this.m_range2s.remove(Integer.valueOf(value)); }



/* 392 */   public void setDynamicAttribute(String name, String value) { this.m_dynamicAttributes.put(name, value); }


  public TransactionType setAvg(double avg) {
/* 396 */     this.m_avg = avg;
/* 397 */     return this;
  }

  public TransactionType setFailCount(long failCount) {
/* 401 */     this.m_failCount = failCount;
/* 402 */     return this;
  }

  public TransactionType setFailMessageUrl(String failMessageUrl) {
/* 406 */     this.m_failMessageUrl = failMessageUrl;
/* 407 */     return this;
  }

  public TransactionType setFailPercent(double failPercent) {
/* 411 */     this.m_failPercent = failPercent;
/* 412 */     return this;
  }

  public TransactionType setGraphTrend(GraphTrend graphTrend) {
/* 416 */     this.m_graphTrend = graphTrend;
/* 417 */     return this;
  }

  public TransactionType setId(String id) {
/* 421 */     this.m_id = id;
/* 422 */     return this;
  }

  public TransactionType setLine50Value(double line50Value) {
/* 426 */     this.m_line50Value = line50Value;
/* 427 */     return this;
  }

  public TransactionType setLine90Value(double line90Value) {
/* 431 */     this.m_line90Value = line90Value;
/* 432 */     return this;
  }

  public TransactionType setLine95Value(double line95Value) {
/* 436 */     this.m_line95Value = line95Value;
/* 437 */     return this;
  }

  public TransactionType setLine9999Value(double line9999Value) {
/* 441 */     this.m_line9999Value = line9999Value;
/* 442 */     return this;
  }

  public TransactionType setLine999Value(double line999Value) {
/* 446 */     this.m_line999Value = line999Value;
/* 447 */     return this;
  }

  public TransactionType setLine99Value(double line99Value) {
/* 451 */     this.m_line99Value = line99Value;
/* 452 */     return this;
  }

  public TransactionType setLongestMessageUrl(String longestMessageUrl) {
/* 456 */     this.m_longestMessageUrl = longestMessageUrl;
/* 457 */     return this;
  }

  public TransactionType setMax(double max) {
/* 461 */     this.m_max = max;
/* 462 */     return this;
  }

  public TransactionType setMin(double min) {
/* 466 */     this.m_min = min;
/* 467 */     return this;
  }

  public TransactionType setStd(double std) {
/* 471 */     this.m_std = std;
/* 472 */     return this;
  }

  public TransactionType setSuccessMessageUrl(String successMessageUrl) {
/* 476 */     this.m_successMessageUrl = successMessageUrl;
/* 477 */     return this;
  }

  public TransactionType setSum(double sum) {
/* 481 */     this.m_sum = sum;
/* 482 */     return this;
  }

  public TransactionType setSum2(double sum2) {
/* 486 */     this.m_sum2 = sum2;
/* 487 */     return this;
  }

  public TransactionType setTotalCount(long totalCount) {
/* 491 */     this.m_totalCount = totalCount;
/* 492 */     return this;
  }

  public TransactionType setTps(double tps) {
/* 496 */     this.m_tps = tps;
/* 497 */     return this;
  }

  public TransactionType() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/transaction/model/entity/TransactionType.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */